#include <QApplication>
#include <QPushButton>
#include <QDebug>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QFile>
//#include <QtUiPlugin/>
#include "ui_Widget.h"
#include "widget.h"
#include <iostream>
//#include <>

int main(int argc, char *argv[]) {
//    QApplication a(argc, argv);
//    QPushButton button("Hello world!", nullptr);
//    button.resize(200, 100);
//    button.show();
//    return QApplication::exec();

    QApplication a(argc, argv);
    myQtTest w;
    w.show();
//    std::system("/usr/local/bin/prlctl start 'Kali Linux'");
    return a.exec();
}
//void U


void myQtTest::startVM_win11() {
    std::system("/usr/local/bin/prlctl start 'Windows 11'");
}

void myQtTest::startVM_win10() {
    std::system("/usr/local/bin/prlctl start 'Windows 10'");
}

void myQtTest::startVM_ubuntu() {
    std::system("/usr/local/bin/prlctl start 'Ubuntu Linux'");
}

void myQtTest::startVM_kali() {
    std::system("/usr/local/bin/prlctl start 'Kali Linux'");
}

void myQtTest::startVM_other() {
    QString VM_name = ui.lineEdit->text();
    std::cout<<VM_name.toStdString()<<std::endl;
    QString command = "/usr/local/bin/prlctl start '";
    command += VM_name;
    command += "'";
    std::string cmd = command.toStdString();

    const char *c = cmd.c_str();
//    std::cout<<c<<std::endl;
    std::system(c);
}
